{% extends "html/html_home.html" %}

{% block content %}
<style>
body{font-family: Verdana, helvetica, arial, sans-serif;}
td{text-align:center;font-size:13px;}
td.rights {border-bottom:1px solid #000;border-right:1px solid #000;}
</style>
<div id="data" style="width:40%;float:left;">
<table border="1" cellspacing="0" cellpadding="0" style="background:#F0F0F0;">
<tr><th>Projects</th><th>Server Status Summary</th><th>Services Status Summary</th><th style="width:100px;">Details</th></tr>
{%for p in projects%}
<tr><td>{{p.projectName}}</td><td>
	<table align="center" border="0" rules="all" cellpadding="0" cellspacing="0">
		<tr><td>&nbsp;&nbsp;Ok&nbsp;&nbsp;</td><td >&nbsp;Warning&nbsp;</td><td >&nbsp;&nbsp;Critical&nbsp;&nbsp;</td></tr>
		<tr><td style="background:#53FF53;">{{p.serversDict.ok}}</td>
			<td style="background:#F0E68C;">{%if p.serversDict.warning > 0%}{{p.serversDict.warning}}{%endif%}</td>
			<td style="background:#FF5151;">{%if p.serversDict.error > 0%}{{p.serversDict.error}}{%endif%}</td></tr>
	</table>
	
	</td><td style="align:center;">
	<table align="center" border="0" rules="all" cellpadding="0" cellspacing="0">
		<tr><td >&nbsp;&nbsp;Ok&nbsp;&nbsp;</td><td >&nbsp;Warning&nbsp;</td><td >&nbsp;&nbsp;Critical&nbsp;&nbsp;</td></tr>
		<tr><td style="background:#53FF53;">{{p.ok}}</td>
			<td style="background:#F0E68C;">{%if p.warning > 0%}{{p.warning}}{%endif%}</td>
			<td style="background:#FF5151;">{%if p.error > 0%}{{p.error}}{%endif%}</td></tr>
	</table>
	</td><td style="font-size:10px;"><a href="/overview/project/{{p.projectId}}">Servers</a><br><a href="./showdetail/service/{{p.projectId}}">Services</a></td></tr>
{% endfor %}
</table>
</div>
<div id="imgall" style="width:60%;float:right;">
{% for img in imgs %}
<img src="/grahaiderimg/{{ img.id }}/w/{{ dashboard_error.width }}/h/{{ dashboard_error.height }}/start/{{ startTime }}/end/{{ endTime }}" height={{ dashboard_error.height }} width={{ dashboard_error.width }} />
{% endfor %}
</div>
<script type="text/javascript" src="/media/js/jquery.min.js"></script>
<script language="javascript"> 
    function reload()
    {
        location.reload(true);
    }
    $(function() {
        if ($(".errornote")[0]) {
            alert($(".errornote").length + "  Error happens");
        }
        else {
            setTimeout(reload, 60000);
        }
    })
</script>

{% endblock %}
